(:
  A procedure to buils the list of all "item"
  for a Drew Trace
  This creates a number, a time event, and an anchor
:)
declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ;
<display>{
let $t := $arguments[1]
let $d := doc($t)/display/event
for $e at $p in $d
return
  <item>{
    <info name="num">{ $p }</info>,
    <info name="time">{ $e/time }</info>,
    <info name="src-anchor">{
      <anchor>{
        <doc>{ $t }</doc>,
        <path>{jj:build-Path($e)}</path>
      }</anchor>
    }</info>
  }</item>
}</display>
